A Relational Derivation of a Functional Program
نویسنده
چکیده
This article is an introduction to the use of relational calculi in deriving programs. We present a derivation in a relational language of a functional program that adds one bit to a binary number. The resulting program is unsurprising, being the standard ‘column of half–adders’, but the derivation illustrates a number of points about working with relations rather than functions.
منابع مشابه
Relational Programming Laws in the Tree, List, Bag, Set Hierarchy
In this paper we demonstrate that the basic rules and calculational techniques used in two extensively documented program derivation methods can be expressed, and, indeed, can be generalised within a relational theory of datatypes. The two methods to which we refer are the so-called “Bird-Meertens formalism” for the construction of functional programs and the “Dijkstra-Feijen calculus” for the ...
متن کاملAlgebra of programming in Agda: Dependent types for relational program derivation
Relational program derivation is the technique of stepwise refining a relational specification to a program by algebraic rules. The program thus obtained is correct by construction. Meanwhile, dependent type theory is rich enough to express various correctness properties to be verified by the type checker. We have developed a library, AoPA, to encode relational derivations in the dependently ty...
متن کاملOn the superstability of a special derivation
The aim of this paper is to show that under some mild conditions a functional equation of multiplicative $(alpha,beta)$-derivation is superstable on standard operator algebras. Furthermore, we prove that this generalized derivation can be a continuous and an inner $(alpha,beta)$-derivation.
متن کاملAlgebra of Programming Using Dependent Types
Dependent type theory is rich enough to express that a program satisfies an input/output relational specification, but it could be hard to construct the proof term. On the other hand, squiggolists know very well how to show that one relation is included in another by algebraic reasoning. We demonstrate how to encode functional and relational derivations in a dependently typed programming langua...
متن کامل(Relational) Programming Laws in the Boom Hierarchy of Types
In this paper we demonstrate that the basic rules and calcu-lational techniques used in two extensively documented program derivation methods can be expressed, and, indeed, can be generalised within a relational theory of datatypes. The two methods to which we refer are the so-called \Bird-Meertens formalism" (see 22]) and the \Dijkstra-Feijen calculus" (see 15]). The current paper forms an abr...
متن کاملذخیره در منابع من
با ذخیره ی این منبع در منابع من، دسترسی به آن را برای استفاده های بعدی آسان تر کنید
عنوان ژورنال:
دوره شماره
صفحات -
تاریخ انتشار 1992